package com.wxg.config.kafka;

import com.wxg.domain.Message;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Conditional;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@Conditional(value = KafkaCondition.class)
public class KafkaMessageListener {

    @KafkaListener(topics = "test", groupId = "test-consumer")
    public void listen(Message message) {
        log.info("接收消息: {}", message);
    }

}
